<<<<<<< HEAD
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/20
 * Time: 1:25
 */

namespace app\index\model;


class Order extends Base
{
    protected $table = 'sy_order';

    public function getSnapItemsAttr($value)
    {
        return json_decode($value, true);
    }

    public function getStatusAttr($value)
    {
        switch ($value) {
            case 1 :
                $value = '未支付';
                break;
            case 2 :
                $value = '已支付';
                break;
            case 3 :
                $value = '已发货';
                break;
            case 4 :
                $value = '已支付(库存不足)';
                break;
            case 8 :
                $value = '已收货';
                break;
        }
        return $value;
    }

    public function product()
    {
        return $this->hasMany('OrderProduct', 'order_id', 'id');
    }
=======
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/20
 * Time: 1:25
 */

namespace app\index\model;


class Order extends Base
{
    protected $table = 'sy_order';

    public function getSnapItemsAttr($value)
    {
        return json_decode($value, true);
    }

    public function getStatusAttr($value)
    {
        switch ($value) {
            case 1 :
                $value = '未支付';
                break;
            case 2 :
                $value = '已支付';
                break;
            case 3 :
                $value = '已发货';
                break;
            case 4 :
                $value = '已支付(库存不足)';
                break;
            case 8 :
                $value = '已收货';
                break;
        }
        return $value;
    }

    public function product()
    {
        return $this->hasMany('OrderProduct', 'order_id', 'id');
    }
>>>>>>> 93c40d8086b7a8d5a9aa3548fdc8eb06a4272cf7
}